const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
  mode: 'production',
  // mode: 'development',
  entry: {
    workerMonoHmsb: './src/workers/worker_mono_hmsb.js',
    tileEditor: './src/tileEditor.js',
    test: './src/test.js'
  },
  output: {
    filename: '[name].js',
    path: path.resolve(__dirname, 'dist')
  },
  devtool: "source-map",
  devServer: {
    static: ['./public'],
    port: 12680,
  },
  plugins: [
    new CopyWebpackPlugin({
      patterns: [
        { 
          from: 'public',
          globOptions: {
            ignore: [
              '**/*.wat',
              '**/*.map',
              '**/*.d.ts',
              '**/*.js',
            ],
          },
        },
      ]
    }),
  ],
};